Post

Replies

Boosts

Views

Activity

Reply to unprojectPoint(_:) broken in iOS 14
Thanks, gchiste! I wasn't previously aware of usesReverseZ. Now that I've read about that property (though not, unfortunately, in Apple's SceneKit documentation), I understand why my results were so non-linear. I will do some experiments with usesReverseZ in a bit. But I'm not seeing why that would change my observation that a z value of 0.5 is apparently mapping to the far clipping plane. Wouldn't usesReverseZ simply control whether z == 0 vs. z == 1 maps to the far clipping plane?
Topic: Spatial Computing SubTopic: ARKit Tags:
Nov ’20
Reply to unprojectPoint(_:) broken in iOS 14
The good news: Yes, if I set usesReverseZ to false, then the behavior of unprojectPoint() returns to the pre-iOS 14 behavior. The bad news: This doesn’t explain why when usesReverseZ == true, a z-value of 0.5 maps to the far clipping plane. For reverse-z, presumably 0.0 should do so? Also, the other mappings look just as non-linear as in pre-iOS 14 — that’s not what is supposed to happen with reverse-z. So it seems to me that unprojectPoint() is working incorrectly when usesReverseZ == true. (Defaulting it to true in iOS 14 seems a bit questionable.)
Topic: Spatial Computing SubTopic: ARKit Tags:
Nov ’20
Reply to sceneView.projectPoint is incredibly slow?
I don't know whether this will be helpful in your case, but here's something I've determined in my app... As noted in this discussion, projectPoint() can apparently block if it is called on two different threads at the same time. I find that projectPoint() is quite fast when called within one of my SCNSceneRendererDelegate methods. These are called in the SCNRenderer render thread; presumably iOS is not making its own calls to projectPoint() while any of these delegate methods are active. But if I call projectPoint() from the main UI thread, its execution time is quite variable and often quite slow. I'm guessing that it is blocking whenever it happens to also be called simultaneously by iOS in the SCNRenderer render thread.
Topic: Graphics & Games SubTopic: SceneKit Tags:
Dec ’21